﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ManageMember.aspx.cs" Inherits="Manageweb_Member_ManageMember" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../images/css.css" rel="stylesheet" type="text/css" />
    
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table width="1020" border="1" cellspacing="0" cellpadding="0" style="margin: 0 auto">
            <tr>
                <td style="background-color: #507cd1; color: White; font-weight: bold; text-align: left;">
                    &nbsp;会员管理
                </td>
            </tr>
        </table>
        <table id="TABLE_Add_Mod" runat="server" border="1" cellpadding="0" cellspacing="0"
            visible="false" width="1020" style="margin: 0 auto">
            <tr>
                <td colspan="2" style="font-weight: bold; color: white; background-color: #507cd1;
                    text-align: left">
                    &nbsp;<asp:Label ID="LB_TableTitle" runat="server">电子币设置</asp:Label>
                </td>
            </tr>
            <tr>
                <td style="width: 150px">
                    &nbsp;用户账号:
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtUserAccount" runat="server" Width="240px" Height="18px" ReadOnly="True"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    用户名:
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtUserName" runat="server" Width="240px" onmouseover="this.select();"
                        ReadOnly="True"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;电子货币:
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtVCurrency" runat="server" Width="240px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtVCurrency"
                        Display="Dynamic" ErrorMessage="*" ValidationGroup="Btn_Submit"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtVCurrency"
                        Display="Dynamic" ErrorMessage="格式错误,必须为正浮点数" ValidationExpression="^[+]?([1-9][0-9]*|0)(\.[0-9]+)?$"
                        ValidationGroup="Btn_Submit"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td colspan="2" style="font-weight: bold; color: white; background-color: #507cd1">
                    <asp:Button ID="Btn_Submit" runat="server" Text="提交" ValidationGroup="Btn_Submit"
                        OnClick="Btn_Submit_Click" />&nbsp;<asp:Button ID="Btn_Cancel" runat="server" Text="取消" />
                </td>
            </tr>
        </table>
        <table border="1" runat="server" cellpadding="0" cellspacing="0" width="1020" style="margin: 0 auto"
            id="Tab_UserInfoUpdate" visible="false">
            <tr>
                <td colspan="2" style="font-weight: bold; color: white; background-color: #507cd1;
                    text-align: left">
                    &nbsp;&nbsp; 会员信息修改
                </td>
            </tr>
            <tr>
                <td style="text-align: center; width: 25%;">
                    &nbsp;账号
                </td>
                <td style="text-align: left">
                    &nbsp;<asp:TextBox ID="TB_LoginID" runat="server" ReadOnly="True"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RFV_TB_LoginID" runat="server" ControlToValidate="TB_LoginID"
                        Display="Dynamic" ErrorMessage="必填字段" ValidationGroup="Btn_Submit"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td style="text-align: center; width: 25%;">
                    &nbsp;姓名
                </td>
                <td style="text-align: left">
                    &nbsp;<asp:TextBox ID="TB_LoginName" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TB_LoginName"
                        Display="Dynamic" ErrorMessage="必填字段" ValidationGroup="Btn_Submit"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td style="text-align: center; width: 25%;">
                    <span lang="zh-cn">&nbsp;&nbsp;&nbsp; 真实姓名:</span></td>
                <td style="text-align: left">
                    <span lang="zh-cn">&nbsp;</span><asp:TextBox ID="txtRealName" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                        ControlToValidate="txtRealName" ErrorMessage="必填字段" SetFocusOnError="True" 
                        ValidationGroup="Btn_Submit"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td style="text-align: center; width: 25%;">
                    &nbsp;性别
                </td>
                <td style="text-align: left">
                    &nbsp;<asp:DropDownList ID="DL_Sex" runat="server">
                        <asp:ListItem Value="1">男</asp:ListItem>
                        <asp:ListItem Value="2">女</asp:ListItem>
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="DL_Sex"
                        Display="Dynamic" ErrorMessage="*" ValidationGroup="Btn_Submit"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td style="text-align: center">
                    &nbsp;国家
                </td>
                <td style="text-align: left">
                    &nbsp;<asp:TextBox ID="TB_Country" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="text-align: center">
                    &nbsp;城市
                </td>
                <td style="text-align: left">
                    &nbsp;<asp:TextBox ID="TB_City" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="text-align: center">
                    &nbsp;地址
                </td>
                <td style="text-align: left">
                    &nbsp;<asp:TextBox ID="TB_Address" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="text-align: center">
                    &nbsp;邮编
                </td>
                <td style="text-align: left">
                    &nbsp;<asp:TextBox ID="TB_PostCode" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="text-align: center">
                    &nbsp;邮箱
                </td>
                <td style="text-align: left">
                    &nbsp;<asp:TextBox ID="TB_Email" runat="server"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="REV_TB_Email" runat="server" ControlToValidate="TB_Email"
                        Display="Dynamic" ErrorMessage="格式不正确" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                        ValidationGroup="Btn_Submit"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td style="text-align: center">
                    &nbsp;电话
                </td>
                <td style="text-align: left">
                    &nbsp;<asp:TextBox ID="TB_Tel" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="text-align: center">
                    &nbsp;手机
                </td>
                <td style="text-align: left">
                    &nbsp;<asp:TextBox ID="TB_Mobile" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="text-align: center">
                    &nbsp;身份证号
                </td>
                <td style="text-align: left">
                    &nbsp;<asp:TextBox ID="TB_CardCode" runat="server" Width="187px"></asp:TextBox><asp:RequiredFieldValidator
                        ID="RequiredFieldValidator4" runat="server" ControlToValidate="TB_CardCode" Display="Dynamic"
                        ErrorMessage="必填字段" ValidationGroup="Btn_Submit"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <%--    <tr>
        <td style="text-align: center">
            &nbsp;重设密码问题</td>
        <td style="text-align: left">
            &nbsp;<asp:TextBox ID="TB_Question" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RFV_TB_Question" runat="server" ControlToValidate="TB_Question"
                Display="Dynamic" ErrorMessage="*" ValidationGroup="Btn_Submit"></asp:RequiredFieldValidator></td>
    </tr>
    <tr>
        <td style="text-align: center">
            &nbsp;重设密码答案</td>
        <td style="text-align: left">
            &nbsp;<asp:TextBox ID="TB_Answer" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RFV_TB_Answer" runat="server" ControlToValidate="TB_Answer"
                Display="Dynamic" ErrorMessage="*" ValidationGroup="Btn_Submit"></asp:RequiredFieldValidator></td>
    </tr>--%>
            <tr>
                <td style="text-align: center">
                    &nbsp;&nbsp;&nbsp; 作废账号:
                </td>
                <td style="text-align: left">
                    &nbsp;<asp:CheckBox ID="chkCancelAccount" runat="server" />
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="2" style="font-weight: bold; color: white; background-color: #507cd1;
                    text-align: center;">
                    <asp:Button ID="Button3" runat="server" Text="提交" OnClick="Button3_Click" ValidationGroup="Btn_Submit" />
                    &nbsp;
                    <input id="Reset1" type="reset" value="重置" />
                </td>
            </tr>
        </table>
        <table border="1" runat="server" cellpadding="0" cellspacing="0" width="1020" style="margin: 0 auto"
            id="Tab_UserScoreSet" visible="false">
            <tr>
                <td style="font-weight: bold; color: white; background-color: #507cd1; text-align: left"
                    colspan="2">
                    &nbsp;&nbsp; 会员积分设置
                </td>
            </tr>
            <tr>
                <td style="width: 25%">
                    会员账号
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtScoreAccount" runat="server" ReadOnly="True"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="width: 25%">
                    会员名
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtScoreUserName" runat="server" ReadOnly="True"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    累计积分
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtScoreLJ" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtScoreLJ"
                        Display="Dynamic" ErrorMessage="*" SetFocusOnError="True" ValidationGroup="Score"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtScoreLJ"
                        Display="Dynamic" ErrorMessage="格式错误" SetFocusOnError="True" ValidationExpression="^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)|[0])$"
                        ValidationGroup="Score"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td>
                    特别积分
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtScoreSpecial" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" Display="Dynamic"
                        ErrorMessage="*" SetFocusOnError="True" ValidationGroup="Score" 
                        ControlToValidate="txtScoreSpecial"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="txtScoreSpecial"
                        Display="Dynamic" ErrorMessage="格式错误" SetFocusOnError="True" ValidationExpression="^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)|[0])$"
                        ValidationGroup="Score"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td colspan="2" style="font-weight: bold; color: white; background-color: #507cd1;
                    text-align: center;">
                    <asp:Button ID="btnSetScore" runat="server" Text="提交" OnClick="btnSetScore_Click"
                        ValidationGroup="Score" />
                    &nbsp;
                    <input id="Reset2" type="reset" value="重置" />
                </td>
            </tr>
        </table>
           <table border="1" runat="server" cellpadding="0" cellspacing="0" width="1020" style="margin: 0 auto"
            id="tab_SetAB4" visible="false">
            <tr>
                <td style="font-weight: bold; color: white; background-color: #507cd1; text-align: left"
                    colspan="2">
                    &nbsp;&nbsp; 会员返利设置
                </td>
            </tr>
            <tr>
                <td style="width: 25%">
                    会员账号
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtUserAccountAB4" runat="server" ReadOnly="True"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="width: 25%">
                    用户名
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtUserNameAB4" runat="server" ReadOnly="True"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    返利:
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtAB4" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="txtScoreLJ"
                        Display="Dynamic" ErrorMessage="*" SetFocusOnError="True" 
                        ValidationGroup="ab4"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ControlToValidate="txtAB4"
                        Display="Dynamic" ErrorMessage="格式错误" SetFocusOnError="True" ValidationExpression="^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)|[0])$"
                        ValidationGroup="ab4"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td colspan="2" style="font-weight: bold; color: white; background-color: #507cd1;
                    text-align: center;">
                    <asp:Button ID="btnAB4" runat="server" Text="提交" OnClick="btnAB4_Click"
                        ValidationGroup="ab4" />
                    &nbsp;
                    <input id="Reset3" type="reset" value="重置" />
                </td>
            </tr>
        </table>
        
        <div style="text-align: center; width: 750px;">
            <asp:Label ID="LB_ManageUser" runat="server" Font-Bold="True" Font-Size="Small" ForeColor="Red"></asp:Label></div>
        <br />
        <table border="1" cellpadding="0" cellspacing="0" width="1020" style="margin: 0 auto">
            <tr>
                <td>
                    <asp:GridView ID="GV_UserList" runat="server" AllowPaging="True" AllowSorting="True"
                        AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" Width="100%"
                        EmptyDataText="暂无数据" OnPageIndexChanging="GV_UserList_PageIndexChanging" 
                        PageSize="30">
                        <FooterStyle Font-Bold="True" ForeColor="White" VerticalAlign="Top" 
                            HorizontalAlign="Center" />
                        <RowStyle BackColor="#EFF3FB" />
                        <Columns>
                            <asp:BoundField DataField="userid" HeaderText="用户帐号" />
                            <asp:BoundField DataField="username" HeaderText="用户名" />
                            <asp:BoundField DataField="userpassword" HeaderText="用户密码" />
                            <asp:BoundField DataField="userphone" HeaderText="电话" />
                            <asp:BoundField DataField="usermobile" HeaderText="手机" />
                               <asp:BoundField DataField="Cdefine5" HeaderText="密钥" />
                            <asp:BoundField DataField="useremail" HeaderText="Email" >
                            
                            <ItemStyle Width="112px" Wrap="True" />
                            </asp:BoundField>
                            
                            <asp:BoundField DataField="Vcurrency" HeaderText="电子货币" DataFormatString="{0:F2}" />
                           <%--  <asp:TemplateField HeaderText="余额">
                              <ItemTemplate>
                                 <%#GetAccountInfo(Eval("userid"))%>
                              </ItemTemplate>
                            </asp:TemplateField>--%>
                            <asp:TemplateField HeaderText="是否作废">
                                <ItemTemplate>
                                    <%#GetMemState(Eval("Cdefine2").ToString() )%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="操作">
                                <ItemTemplate>
                                    <asp:LinkButton ID="btnUpdate" runat="server" CommandArgument='<%# String.Format("{0}|{1}|{2}", Eval("userid"), Eval("username"), Eval("Vcurrency"))%>'
                                        OnCommand="btnUpdate_Command" Visible='<%#IsAllow %>'>修改电子币</asp:LinkButton>
                                    <asp:LinkButton ID="btnUpdateUserInfo" runat="server" CommandArgument='<%# Eval("userid")%>'
                                        OnCommand="btnUpdateUserInfo_Command">修改会员信息</asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton1" runat="server" PostBackUrl='<%# "SetMemberXX.aspx?userID="+Eval("userid")%>'>设置下线</asp:LinkButton>
                                    <asp:LinkButton ID="lbtnSetScore" runat="server" CommandArgument='<%# String.Format("{0}|{1}|{2}|{3}", Eval("userid"), Eval("username"), Eval("LjScore"), Eval("SpecialScore") )%>'
                                        OnCommand="lbtnSetScore_Command"  Visible='<%#IsAllow %>'>设置积分</asp:LinkButton>
                                     <asp:LinkButton ID="LinkButton2" runat="server" PostBackUrl='<%# "ManagePosition.aspx?userID="+Eval("userid")%>'>安置更改</asp:LinkButton> 
                                    <asp:LinkButton ID="lbtnSetAB4" runat="server" CommandArgument='<%#String.Format("{0}|{1}",Eval("userid"),Eval("username"))   %>'
                                        OnCommand="lbtnSetAB4_Command"  Visible='<%#IsAllow %>'>返利</asp:LinkButton>
                                        
                                         <asp:LinkButton ID="lbtnSetMiYao" runat="server" CommandArgument='<%#String.Format("{0}|{1}",Eval("userid"),Eval("Cdefine5"))   %>'
                                        OnCommand="lbtnSetMiYao_Command" ToolTip="重置密钥为:666666">重置密钥</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                 
                        <PagerStyle BackColor="#507CD1" BorderStyle="None" HorizontalAlign="Center" />
                 
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <EditRowStyle BackColor="#2461BF" />
                        <AlternatingRowStyle BackColor="White" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
